import store from "@/store";
export default{
  onShow() {
    let task = store.state.socket.taskReceiveingNum;
    let invite = store.state.socket.invitationScoreNum;
    if (Number(task) > 0) {
      uni.setTabBarBadge({
        index: 2,
        text: task.toString()
      });
    } else {
      uni.removeTabBarBadge({
        index: 2
      });
    }
    if (Number(invite) > 0) {
      uni.setTabBarBadge({
        index: 1,
        text: invite.toString()
      });
    } else {
      uni.removeTabBarBadge({
        index: 1
      });
    }
  }
};
